//@author A0096440E
#ifndef TASKITGLOBAL_H_
#define TASKITGLOBAL_H_

//TaskItGlobal.h purpose is to provide our program with a header file
//to store all constant strings and constant integers declaration under
//one file. It also included all neccessary header files that most of
//our program requires in its execution.
#include <iostream>
#include <string>
#include <fstream>
#include <sstream>
#include <vector>
#include <iomanip>
#include <assert.h>
#include <algorithm>

using namespace std;

const string MESSAGE_INITIAL = "Enter username: ";
const string MESSAGE_WELCOME = "Hi. These are your tasks for today. What would you like to do? Press \"F1\" to see the help section.";
const string MESSAGE_ADDED = "Task has been successfully added to TaskIt:";
const string MESSAGE_ADDED_DATE_PAST = "Note: Date specified has already passed.";
const string MESSAGE_DELETED = "Task has been successfully deleted from TaskIt.";
const string MESSAGE_EDITED = "The follwing task has been successfully edited in TaskIt:";
const string MESSAGE_MARKED = "Task has been successfully marked done in TaskIt.";
const string MESSAGE_UNMARKED = "Task has been successfully marked not done in TaskIt.";
const string MESSAGE_INVALID = "An invalid command is detected, please type in correct command.";
const string MESSAGE_BLOCKED = "Timeslot is successfully blocked for task.";
const string MESSAGE_CONFIRM = "Task is confirmed and successfully added to TaskIt:";
const string MESSAGE_UNDO = "Undo-ed previous action.";
const string MESSAGE_CONFIRM_PERMANENT_CLEAR_ONE = "WARNING: All past activities that are done will be cleared from database.";
const string MESSAGE_CONFIRM_PERMANENT_CLEAR_TWO = " You will not be able to undo after this action. Do you want to proceed? (type y/n)";
const string MESSAGE_CLEARED = "All past activities that are done have been cleared.";
const string MESSAGE_NOT_CLEARED = "Did not proceed with clearing of tasks.";

const string INVALID_REQUEST = "Invalid Request.";
const string INVALID_ADD = "No activity detected. Please re-enter your task.";
const string INVALID_DELETE = "Item number requested do not exist to delete task. Please re-enter command.";
const string INVALID_EDIT = "Item number requested is not valid. Please re-enter command.";
const string INVALID_SEARCH = "Keyword provided do not yield any results. Please re-enter command.";
const string INVALID_MARK = "Item number requested do not exist to mark task. Please re-enter command.";
const string INVALID_ALREADY_MARKED = "Task has already been marked done previously.";
const string INVALID_UNMARK = "Item number requested do not exist to unmark task. Please re-enter command.";
const string INVALID_CONFIRM = "Item number requested do not exist to confirm task. Please re-enter command.";
const string INVALID_CONFIRM_TASK = "Task is not a blocked task. Unable to confirm.";
const string INVALID_ALREADY_UNMARKED = "Task is not done. Unable to unmark.";
const string INVALID_UNDO = "No actions to undo";
const string INVALID_DATE = "Invalid date entered. Please follow this format: DDMMYY";
const string INVALID_TIME = "Invalid time entered. Please follow this format: HHMM";
const string INVALID_VIEW = "Invalid criteria entered. Please re-enter view criteria.";
const string INVALID_DATE_TIME = "Time detected without date. Please re-enter your task.";
const string INVALID_BLOCK = "Must have date for blocking.";
const string INVALID_TIME_COMBINATION = "Start time is later then end time. Please enter two tasks over two days if needed.";
const string INVALID_USE_OF_BLOCK = "There is a detection of invalid use of Block: . Please do not use such keyword.";

const string LIST_OF_COMMANDS = "TaskIt list of commands: add, delete, fdelete, edit, fedit, view, mark, unmark, block, confirm, undo, search, clear, help.";

const string COMMAND_ADD = "add";
const string COMMAND_DELETE = "delete";
const string COMMAND_F_DELETE = "fdelete";
const string COMMAND_EDIT = "edit";
const string COMMAND_F_EDIT = "fedit";
const string COMMAND_VIEW = "view";
const string COMMAND_SEARCH = "search";
const string COMMAND_MARK = "mark";
const string COMMAND_UNMARK = "unmark";
const string COMMAND_UNDO = "undo";
const string COMMAND_HELP = "help";
const string COMMAND_BLOCK = "block";
const string COMMAND_CONFIRM = "confirm";
const string COMMAND_CLEAR = "clear";
const string COMMAND_YES = "y";
const string COMMAND_NO = "n";

const string CLASH_FOUND_EDITED = "There is a clash of activity with this task in edited time slot:";
const string CLASH_FOUND_UNDO = "Editing is done. Undo to revert changes.";
const string CLASH_FOUND_BLOCKED = "Clash with existing task.";
const string CLASH_FOUND = "There is a clash of activity at the same time slot. Would you like to overlap tasks? (y/n)";
const string NOT_ADDED = "Task is not added.";

//@author A0096509U
const string DISPLAY_ACTIVITY = "Activity: ";
const string DISPLAY_VENUE = "Venue: ";
const string DISPLAY_TIME_START = "Time Start: ";
const string DISPLAY_TIME_END = "Time End: ";
const string DISPLAY_CATEGORY = "Category: ";
const string DISPLAY_DATE = "Date: ";
const string DISPLAY_STATUS = "Status: ";
const string DISPLAY_DONE = "Done";
const string DISPLAY_NOT_DONE = "Not Done";

const string ACTIVITY = "activity";
const string VENUE = "venue";
const string TIME_START = "time start";
const string TIME_END = "time end";
const string CATEGORY = "category";
const string DATE_FIELD = "ddmmyy";
const string SEARCH = "search";

const string VIEW_ALL = "all";
const string VIEW_INITIAL = "View Initial";
const string VIEW_NOTHING = "No tasks to view.";
const string VIEW_BLOCK = "block";

const string READ_DONE = "true";
const string READ_NOT_DONE = "false";

const string FILE_TYPE = ".txt";
const string STORAGE_FILE_NAME = "Storage.txt";
const string TEMP_NAME = "Temp.txt";

const string EMPTY_STRING = "\0";
const string EMPTY_FIELD = "-";

const string NEW_LINE = "\r\n";
const string TO = "to";
const string COLON = ":";
const string BLOCK_FUNCTION = "Block: ";
const string BLOCK_FUNCTION_TWO = "Block:";

//@author A0080442N
const string LOG_SCHEDULER_FILE_NAME = "LogFile.txt";
const string LOG_SCHEDULER_WELCOME = "Scheduler: Welcomed User";
const string LOG_SCHEDULER_EXECUTE_COMMAND = "Scheduler: Execute Command";
const string LOG_SCHEDULER_ADDED = "Scheduler: Task Added";
const string LOG_SCHEDULER_DELETED = "Scheduler: Task Deleted";
const string LOG_SCHEDULER_EDITED = "Scheduler: Task Edited";
const string LOG_SCHEDULER_SEARCHED = "Scheduler: Task Searched Depends On Accurate Keyword";
const string LOG_SCHEDULER_MARK = "Scheduler: Task Marked";
const string LOG_SCHEDULER_UNMARK = "Scheduler: Task Unmarked";
const string LOG_SCHEDULER_UNDO = "Scheduler: Action Undoed Depends On Whether Previous Action Is Legit";
const string LOG_SCHEDULER_HELP = "Scheduler: Displayed Help";
const string LOG_SCHEDULER_INVALID_COMMAND = "Scheduler: Invalid Command Detected";
const string LOG_SCHEDULER_ADD_TEMP = "Scheduler: Added Temp Task To File Because Of Clash";
const string LOG_SCHEDULER_SET_TIME_SUCCESSFUL = "Scheduler: Time Is Created Successfully";
const string LOG_SCHEDULER_INVALID_ADD = "Scheduler: Invalid Activity Detected";
const string LOG_SCHEDULER_INVALID_DATE_TIME = "Scheduler: Time Detected Without Date";
const string LOG_SCHEDULER_SET_DATE_SUCCESSFUL = "Scheduler: Date Is Created Successfully";
const string LOG_SCHEDULER_NOT_ADDED = "Scheduler: Task Not Added";
const string LOG_SCHEDULER_INVALID_DELETE = "Scheduler: Invalid Position Of Task Given To Delete";
const string LOG_SCHEDULER_INVALID_EDIT = "Scheduler: Invalid Position Of Task Given To Edit";
const string LOG_SCHEDULER_EDITED_WHILE_CLASHED = "Scheduler: Task Edited With Clash";
const string LOG_SCHEDULER_INVALID_MARK = "Scheduler: Invalid Position of Task Given To Mark";
const string LOG_SCHEDULER_INVALID_UNMARK = "Scheduler: Invalid Position of Task Given To Unmark";
const string LOG_SCHEDULER_SIFTING_VIEW = "Scheduler: Analyzing Correct View Criteria";
const string LOG_SCHEDULER_NO_VIEW = "Scheduler: No Tasks To View";
const string LOG_SCHEDULER_VIEW = "Scheduler: Tasks Displayed For Viewing";
const string LOG_SCHEDULER_SIFTING_COMMAND = "Scheduler: Analyzing Correct Command";
const string LOG_SCHEDULER_INVALID_TIME_COMBINATION = "Scheduler: Start time is later then end time.";
const string LOG_SCHEDULER_NOT_FOUND = "Scheduler: Task is not found";
const string LOG_SCHEDULER_FOUND = "Scheduler: Task is found";

const string LOG_STORAGE_INITIALIZED = "Storage: Get number of task";
const string LOG_STORAGE_SET_OWNER ="Storage: Set owner name";
const string LOG_STORAGE_SORT = "Storage: Sorted";
const string LOG_STORAGE_FILE_OPENED = "Storage: File with username is opened";
const string LOG_STORAGE_CREATE_NEW_FILE= "Storage: New file is created";
const string LOG_STORAGE_SAVED = "Storage: File is saved";
const string LOG_STORAGE_TEMPFILE = "Storage: Temp file is created";
const string LOG_STORAGE_ADD_CONFLICTED="Storage: Conflicted task is added";
const string LOG_STORAGE_NOT_ADD_CONFLICTED = "Storage: Conflicted task is not added";
const string LOG_STORAGE_ADD = "Storage: Task is added";
const string LOG_STORAGE_EDIT ="Storage: Task is edited";
const string LOG_STORAGE_DELETED ="Storage: Task is deleted";
const string LOG_STORAGE_RETRIEVE = "Storage: Get task details";
const string LOG_STORAGE_UNDO ="Storage: Successfully undo";
const string LOG_STORAGE_INVALID_UNDO = "Storage: No previous command is found";
const string LOG_STORAGE_MAKE_DONE = "Storage: Task is marked done";
const string LOG_STORAGE_MAKE_UNDONE = "Storage: Task is marked undone";
const string LOG_STORAGE_INVALID_INDEX ="Storage: Unable to find task with given index";
const string LOG_STORAGE_DISPLAY ="Storage: Get display information";

const string TOO_MANY_DATES = "Too many dates/day detected. Unable to do a quick add.";
const string Monday = "Monday";
const string monday = "monday";
const string mon = "mon";
const string Tuesday = "Tuesday";
const string tuesday = "tuesday";
const string tues = "tues";
const string Wednesday = "Wednesday";
const string wednesday = "wednesday";
const string wed = "wed";
const string Thursday = "Thursday";
const string thursday = "thursday";
const string thurs = "thurs";
const string Friday = "Friday";
const string friday = "friday";
const string fri = "fri";
const string Saturday = "Saturday";
const string saturday = "saturday";
const string sat = "sat";
const string Sunday = "Sunday";
const string sunday = "sunday";
const string sun = "sun";
const string This = "This";
const string thisString = "this";
const string Next = "Next";
const string nextString = "next";
const string Today = "Today";
const string today = "today";
const string Tomorrow = "Tomorrow";
const string tomorrow = "tomorrow";
const string tmr = "tmr";
const string tml = "tml";
const string On = "On";
const string on = "on";

const char DOT = '.';
const char WHITE_SPACE = ' ';
const char NUM_9 = '9';
const char NUM_0 = '0';
const char OPEN_SQUARE_BRACKET = '[';
const char CLOSED_SQUARE_BRACKET = ']';
const char SMALL_A = 'a';
const char SMALL_Z = 'z';
const char CAPS_A = 'A';
const char CAPS_Z = 'Z';

//@author A0096440E
const int ARRAY_LIMIT = 255;
const int FIRST_CHARACTER = 0;
const int INITIAL_VALUE = 0;
const int ONE_STARTING_VALUE = 1;
const int TIME_SIZE = 4;
const int NUM_OF_INFO = 8;
const int NUM_MOD_FOUR = 4;
const int NUM_MOD_HUNDRED = 100;
const int NUM_MOD_TEN_THOUSAND = 10000;
const int NUM_LESS_THAN_TEN = 10;
const int SHIFT_INDEX_BY_ONE = 1;
const int INVALID_UPPER_BOUND = 311299;
const int INVALID_LOWER_BOUND = 10100;
const int TIME_UPPER_BOUND = 2359;
const int TIME_LOWER_BOUND = 0;
const int SLOT_ZERO = 0;
const int SLOT_ONE = 1;
const int SLOT_TWO = 2;
const int SLOT_THREE = 3;
const int SLOT_FOUR = 4;
const int SLOT_FIVE = 5;
const int SLOT_SIX = 6;
const int SLOT_SEVEN = 7;
const int ONE = 1;
const int TWO = 2;
const int THREE = 3;
const int FOUR = 4;
const int FIVE = 5;
const int SIX = 6;
const int SEVEN = 7;
const int INVALID_INDEX = -1;
const int BELOW_ZERO_INDEX = 0;

//@author A0080442N
const int DAYS_IN_MONTHS[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
const int LEAP_YEAR_DAYS_IN_MONTHS[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
const int MONTHS_IN_YEARS = 12;
const int DAYS_IN_WEEK = 7;
const int DAYS_IN_MONTH = 31;

const int HOURS_IN_DAYS = 23;
const int MINS_IN_HOURS = 59;

//@author A0096440E
static char buffer[ARRAY_LIMIT];

const enum CommandType {
	ADD_TASK, DELETE_TASK, F_DELETE_TASK, EDIT_TASK, F_EDIT_TASK, VIEW_TASK, SEARCH_TASK, 
	MARK_TASK, UNMARK_TASK, UNDO_TASK, BLOCK, CONFIRM, HELP, YES, NO, CLEAR, INVALID
};

#endif